<!doctype html>
<html>

<head>
    <meta charset="UTF-8" />
    <title><?php echo $config['app']?>安装向导 - Powered by <?php echo $config['company']?></title>
    <link rel="stylesheet" href="<?php echo $this->assets('/static/install/css/install.css'); ?>" />
</head>

<body>
    <div class="wrap">
        <header>
            <div class="title">
                <span class="app"><?php echo $config['app']?></span> 安装向导
            </div>
            <div class="version"></div>
        </header>
        <div class="step">
            <ul>
                <li class="current"><span>1</span>检测环境</li>
                <li><span>2</span>创建数据</li>
                <li><span>3</span>完成安装</li>
            </ul>
        </div>
        <section class="content">
            <table class="m-table">
                <caption>运行环境</caption>
                <thead>
                    <th width="25%">环境检测</th>
                    <th width="25%">所需配置</th>
                    <th width="25%">当前配置</th>
                    <th width="25%">检测状态</th>
                </thead>
                <tbody>
                    <?php foreach($data['server'] as $item): ?>
                    <tr>
                        <td><?php echo $item['title']; ?></td>
                        <td><?php echo $item['need']; ?></td>
                        <td><?php echo $item['value']; ?></td>
                        <td><?php echo $item['status'] ? '<span style="color: #339966">&radic;</span>' : '<span style="color: #ff0000">&Chi;</span>'; ?></td>
                    </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
            <table class="m-table">
                <caption>目录/文件读写权限<small>（基于软件根目录）</small></caption>
                <thead>
                    <th width="25%">环境检测</th>
                    <th width="25%">所需权限</th>
                    <th width="25%">当前权限</th>
                    <th width="25%">检测状态</th>
                </thead>
                <tbody>
                    <?php foreach($data['dir'] as $item): ?>
                    <tr>
                        <td><?php echo $item['title']; ?></td>
                        <td><?php echo $item['need']; ?></td>
                        <td><?php echo $item['value']; ?></td>
                        <td><?php echo $item['status'] ? '<span style="color: #339966">&radic;</span>' : '<span style="color: #ff0000">&Chi;</span>'; ?></td>
                    </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
            <div class="buttom">
                <a href="<?php echo $this->container->url->build('/install', ['step' => 2]) ?>" class="btn">重新检测</a>
                <?php if($err){?>
                <a href="javascript:void(0)" onClick="javascript:alert('安装环境检测未通过，请检查')" class="btn" style="background: gray;">下一步</a>
                <?php }else{?>
                <a href="<?php echo $this->container->url->build('/install', ['step' => 3]) ?>" class="btn">下一步</a>
                <?php }?>
            </div>
        </section>
    </div>
    <footer class="footer">
        &copy; 2020-2021 <?php echo $config['company']?>
    </footer>
</body>

</html>